﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.Entity;

public static class ExtensionOfDbSet
{
    /// <summary>
    /// Adds the list.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="target">The target.</param>
    /// <param name="elements">The elements.</param>
    public static void AddList<T>(this DbSet<T> target, List<T> elements) where T : class
    {
        elements.ForEach(x => target.Add(x));
    }

    public static void AddList<T>(this ICollection<T> target, List<T> elements) where T : class
    {
        elements.ForEach(x => target.Add(x));
    }


}